import { request } from '@/utils/request';

/**
 * @description
 */
export function areaOption(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/areaOption',
    method: 'get',
    params,
  });
}

export function roadOption(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/roadOption',
    method: 'get',
    params,
  });
}
//路网基础信息
export function getAreaInfo(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/queryAreaInfo',
    method: 'get',
    params,
  });
}
// 道路分页接口 /basic/queryRoadPage
export function queryRoadPage(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/queryRoadPage',
    method: 'get',
    params,
  });
}
// 道路详情接口
export function getRoadDetail(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/getRoadDetail',
    method: 'get',
    params,
  });
}
export function getQuery(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/basic/query',
    method: 'get',
    params,
  });
}

export function roadBlockInfoByRoadName(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/observe/roadBlockInfoByRoadName',
    method: 'get',
    params,
  });
}

export function getRoadBasicList(params?: API.CaptchaParams) {
  return request<API.CaptchaResult>({
    url: '/homePage/getRoadBasicList',
    method: 'get',
    params,
  });
}

// 根据地图缩放等级查询道路信息 

export function queryRoadByLevel(params: any) {
  return request<any>({
    url: '/basic/queryRoadByLevel',
    method: 'get',
    params,
  });
}
// 根据道路名等模糊查询道路信息
export function getRoadInfoByKey(data: any) {
  return request<any>({
    url: '/basic/getRoadInfoByKey',
    method: 'post',
    data,
  });
}


export function getRoadBasicByIds(data: any) {
  return request<any>({
    url: '/homePage/getRoadBasicByIds',
    method: 'post',
    data,
  });
}
/**
 * 根据道路名等模糊查询道路信息
 * 
 * 
    "roadName": "北",
    "jdcds": 3        // 车道数，非必填

 */

// export function getRoadInfoByKeyApi(data: any) {
//   return request<any>({
//     url: '/basic/getRoadInfoByKey',
//     method: 'post',
//     data,
//   });
// }
/***
 * 根据道路名等模糊查询道路车道数列表
 * /basic/getRoadJdcdsByKey
 */
export function getRoadJdcdsByKey(data: any) {
  return request<any>({
    url: '/basic/getRoadJdcdsByKey',
    method: 'post',
    data,
  });
}
/***
 * 路口现状--新增
 * /api/roadJunction/add
 */
export function addRoadJunction(data: any) {
  return request<any>({
    url: '/api/roadJunction/add',
    method: 'post',
    data,
  });
}
/***
 * 路口现状--查询列表
 * /api/roadJunction/findAllList
 */
export function findAllRoadJunctionList(data: any) {
  return request<any>({
    url: '/api/roadJunction/findAllList',
    method: 'post',
    data,
  });
}
/***
 * 路口现状--查看详情
 * /api/roadJunction/detail/{id}
 */
export function findAllRoadJunctionDetail(id: any) {
  return request<any>({
    url: `/api/roadJunction/detail/${id}`,
    method: 'post',
    // data,
  });
}
/***
 * 路口现状--修改保存
 * /api/roadJunction/update
 */
export function roadJunctionUpdate(data: any) {
  return request<any>({
    url: `/api/roadJunction/update`,
    method: 'post',
    data,
  });
}
/***
 * 
 * 路口现状--删除
 * /api/roadJunction/deleteById/{id}
 */
export function delelteRoadJunction(id: any) {
  return request<any>({
    url: `/api/roadJunction/deleteById/${id}`,
    method: 'post',
    // data,
  });
}
/***
 * 获取oss临时文件url
 * /api/upload/getOssTempUrl
 */
export function getOssTempUrl(data: any) {
  return request<any>({
    url: `/api/upload/getOssTempUrl`,
    method: 'post',
    data,
  });
}